package com.hhq.sso.common.service;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.validation.constraints.NotEmpty;

import java.util.List;

/**
 * <p>
 * Description: 基础业务接口
 * </p>
 *
 * @author : xiaodong.yang
 * @date : 2024/6/19 15:04
 */
public interface BaseService<T> extends IService<T> {

    /**
     * 逻辑删除
     *
     * @param ids id集合(逗号分隔)
     * @return boolean
     */
    boolean deleteLogic(@NotEmpty List<Long> ids);

    /**
     * 判断字段是否重复
     *
     * @param field 字段
     * @param value 字段值
     * @param excludedId 排除的id
     * @return boolean
     */
    boolean isFieldDuplicate(SFunction<T, ?> field, Object value, Long excludedId);
}
